package cn.fantasy.study;

import cn.fantasy.study.entity.User;
import cn.fantasy.study.service.IUserService;

/**
 * 通过工厂模式解除耦合
 * 使用反射创建对象
 */
public class Factory {
    public static void main(String[] args) {
        IUserService iuserservice = (IUserService) BeanFactory.getBean("userService");

        iuserservice.login("fantasy", "abc123");

        User user = new User("zhangliang", "123456");
        iuserservice.register(user);
    }
}
